-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix statement vs expr #62
Fix statement vs expr #62
Conversation
1563033
to
286f878
Compare
631ab6a
to
362dd1a
Compare
@effectfully, I added a benchmark ( Does the following output looks good to you?
|
Yes. We'll need some more refined tool to output other interesting stats (how many We'll also need to see if it makes the compiler tests slower, 'cause they are already quite slow. But for now looks good. |
0d04fa9
to
e379866
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll review the generators stuff a bit later.
There are some issues with
|
ea1414d
to
884b3ca
Compare
1895d10
to
8a10069
Compare
Fixes effectfully#51, effectfully#52 We make the following changes to the AST by adding - a newly introduced a top-level `Program` node, which is parent to - a newly introduced `Statements` node, which is parent to - a `Statement` node, which is chaned to be a parent of - an `Expr` node. We make the following changes to Statement by - introduce a `EFor` node to the typed AST. We update update the evaluator by - providing an explicit transformer stack (`EvalT`), - fixing the semantics for for loops, and - switching to CPS both in evaluator and normaliser. We also add minor improvements to the codebase by - fixing `Sign` vs `Sig` naming issue, - cleaning up some naming conventions, and - providing `stack bench` benchmark for testing generators for the new AST.
5bd322e
to
7685541
Compare
I suspect there will be a test error, but it will be tied to #76 due to lack of assignments and proper typing environments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's get this in!
where | ||
go i fkont = withVar var (Some $ fromIntegral i) $ | ||
evalStatements body fkont | ||
actualEnd = Some $ fromIntegral $ max start end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per previous discussion we already know in the otherwise
clause that start > end
and hence can do withVar var start kont
there instead, but not a big deal.
Fixes #51, #54
Essentially we make
[Statement f]
as our program and the main parsing rule.Sign
vsSig
naming issue,Statements f
newtype for[Statement f]
Program f
newtype ofStatements f
as top-level node of AST.stmt
prefix for statements, andexpr
prefix for expressions.stack bench
for testing the generators.In addition we add the benchmark of quickcheck generators